package org.example.microservice.sys.feign;

import org.example.microservice.sys.model.po.Department;
import org.example.microservice.sys.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feign/department")
public class DepartmentFeignImpl {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/{id}")
    public Department getDepartment(@PathVariable String id) {
        Department department = departmentService.getById(id);
        return department;
    }
}
